package com.itlxd.service.impl;

import com.itlxd.entity.OrderDetail;
import com.itlxd.mapper.OrderDetailMapper;
import com.itlxd.service.IOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 订单明细表 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-12-25
 */
@Service
public class OrderDetailServiceImpl implements IOrderDetailService {

    @Autowired
    private OrderDetailMapper orderDetailMapper;

    @Override
    public Long insertOrderDetail(List<OrderDetail> orderDetails) {
        long count = orderDetails.stream().map(item -> {
            orderDetailMapper.insert(item);
            return null;
        }).count();

        for (OrderDetail orderDetail : orderDetails) {
            
        }
        return count;
    }

    @Override
    public Integer save(OrderDetail orderDetail) {
        return null;
    }
}
